﻿<Application
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	x:Class="AllenalaMente.App">

  <!--Risorse applicazione-->
  
  <!-- Normal Template-->
  <Application.Resources>
    <ControlTemplate x:Key="BlueTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Image x:Name="normal" Height="300" Width="215" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonBlue.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
          <Image.RenderTransformOrigin>
            <Point X="0.5" Y="0.5"></Point>
          </Image.RenderTransformOrigin>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="RedTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Image x:Name="normal" Height="250" Width="190" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonRed.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    
    <ControlTemplate x:Key="GreenTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
                <Image x:Name="normal" Height="250" Width="190" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonGreen.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <!-- Small Template-->
    
    <ControlTemplate x:Key="BlueSmallTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Image x:Name="normal" Height="180" Width="100" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonBlue.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="GreenSmallTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
                <Image x:Name="normal" Height="200" Width="152" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonGreen.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>


    <ControlTemplate x:Key="RedSmallTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
                <Image x:Name="normal" Height="180" Width="100" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonRed.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <!-- Template Big-->
    <ControlTemplate x:Key="BigBlueTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
                <Image x:Name="normal" Height="100" Width="290" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonBlue.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="BigRedTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
                <Image x:Name="normal" Height="100" Width="290" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonRed.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="BigGreenTemplate" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard >
                <DoubleAnimationUsingKeyFrames RepeatBehavior="1" AutoReverse="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="normal" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="16"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
                <Image x:Name="normal" Height="100" Width="290" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/buttonGreen.png">
          <Image.RenderTransform>
            <TranslateTransform ></TranslateTransform>
          </Image.RenderTransform>
        </Image>
        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>




    

  </Application.Resources>

  <Application.ApplicationLifetimeObjects>
    <!--Oggetto richiesto che gestisce gli eventi di durata dell'applicazione-->
    <shell:PhoneApplicationService 
			Launching="Application_Launching" Closing="Application_Closing" 
			Activated="Application_Activated" Deactivated="Application_Deactivated"/>
  </Application.ApplicationLifetimeObjects>
</Application>
